package CreationModel.SingletonModel;

/**
 * double check
 * @author 王蕾 [wanglei_dev@cyou-inc.com]
 * @date 2017-11-28 10:00:00
 */
public class DoubleCheckSingleton {

    private static volatile DoubleCheckSingleton instance;

    private DoubleCheckSingleton() {
    }

    public static DoubleCheckSingleton getInstance(){
        if (instance == null){
            synchronized (DoubleCheckSingleton.class){
                if (instance == null){
                    return new DoubleCheckSingleton();
                }
            }
        }
        return  instance;
    }
}
